   function ext_totala(fmobj){
        //var fmobj = document.calc1;
        //先清空月还款数下拉框
        while ((k = fmobj.month_money2.length - 1) >= 0){
            fmobj.month_money2.options.remove(k);
        }
        var years = fmobj.years.value;
        var month = fmobj.years.value * 12;

        fmobj.month1.value = month + "(月)";
        fmobj.month2.value = month + "(月)";
        if(fmobj.type.value == 3 ){
            //--  组合型贷款(组合型贷款的计算，只和商业贷款额、和公积金贷款额有关，和按贷款总额计算无关)
            if(!reg_Num(fmobj.total_sy.value)){alert("混合型贷款请填写商贷比例");fmobj.total_sy.focus();return false;}
            if(!reg_Num(fmobj.total_gjj.value)){alert("混合型贷款请填写公积金比例");fmobj.total_gjj.focus();return false;}
            if(fmobj.total_sy.value == null){fmobj.total_sy.value = 0;}
            if(fmobj.total_gjj.value == null){fmobj.total_gjj.value = 0;}
            var total_sy = fmobj.total_sy.value;
            var total_gjj = fmobj.total_gjj.value;
            fmobj.fangkuan_total1.value = "略";//房款总额
            fmobj.fangkuan_total2.value = "略";//房款总额
            fmobj.money_first1.value = 0;//首期付款
            fmobj.money_first2.value = 0;//首期付款

            //贷款总额
            var total_sy = parseInt(fmobj.total_sy.value);
            var total_gjj = parseInt(fmobj.total_gjj.value);
            var daikuan_total = total_sy + total_gjj;
            fmobj.daikuan_total1.value = daikuan_total;
            fmobj.daikuan_total2.value = daikuan_total;

            //月还款
            var lilv_sd = $('#sdlv').val() / 100;//得到商贷利率
            var lilv_gjj = $('#gjlv').val() / 100;//得到公积金利率

            //1.本金还款
            //月还款
            var all_total2 = 0;
            var month_money2 = "";
            for(j = 0; j < month; j++){
                //调用函数计算: 本金月还款额
                huankuan = getMonthMoney2(lilv_sd, total_sy, month, j) + getMonthMoney2(lilv_gjj, total_gjj, month, j);
                all_total2 += huankuan;
                huankuan = Math.round(huankuan * 100) / 100;
                //fmobj.month_money2.options[j] = new Option( (j + 1) +"月," + huankuan + "(元)", huankuan);
                month_money2 += (j + 1) + "月," + huankuan + "(元)\n";
            }
            fmobj.month_money2.value = month_money2;
            //还款总额
            fmobj.all_total2.value = Math.round(all_total2 * 100) / 100;
            //支付利息款
            fmobj.accrual2.value = Math.round((all_total2 - daikuan_total) * 100) / 100;

            //2.本息还款
            //月均还款
            var month_money1 = getMonthMoney1(lilv_sd, total_sy, month) + getMonthMoney1(lilv_gjj, total_gjj, month);//调用函数计算
            //fmobj.month_money1.value = Math.round(month_money1 * 100) / 100 + "(元)";
            $("#month_money1").val(Math.round(month_money1 * 100) / 100 + "(元)");
            //还款总额
            var all_total1 = month_money1 * month;
            fmobj.all_total1.value = Math.round(all_total1 * 100) / 100;
            //支付利息款
            fmobj.accrual1.value = Math.round((all_total1 - daikuan_total) * 100) / 100;
        }else{
            //--  商业贷款、公积金贷款
            var lilv = $('#singlelv').val() / 100;//得到利率
            if(fmobj.jisuan_radio[0].checked == true){
                //------------ 根据单价面积计算
                if(!reg_Num(fmobj.price.value)){alert("请填写单价");fmobj.price.focus();return;}
                if(!reg_Num(fmobj.sqm.value)){alert("请填写面积");fmobj.sqm.focus();return;}

                //房款总额
                var fangkuan_total = fmobj.price.value * fmobj.sqm.value;
                fmobj.fangkuan_total1.value = fangkuan_total;
                fmobj.fangkuan_total2.value = fangkuan_total;
                //贷款总额
                var daikuan_total = (fmobj.price.value * fmobj.sqm.value) * (fmobj.anjie.value / 10);
                fmobj.daikuan_total1.value = daikuan_total;
                fmobj.daikuan_total2.value = daikuan_total;
                //首期付款
                var money_first = fangkuan_total - daikuan_total;
                fmobj.money_first1.value = money_first
                fmobj.money_first2.value = money_first;
            }else{
                //------------ 根据贷款总额计算
                if (fmobj.daikuan_total000.value.length == 0){alert("请填写贷款总额");fmobj.daikuan_total000.focus();return false;}

                //房款总额
                fmobj.fangkuan_total1.value = "略";
                fmobj.fangkuan_total2.value = "略";
                //贷款总额
                var daikuan_total = fmobj.daikuan_total000.value * 10000;
                fmobj.daikuan_total1.value = daikuan_total;
                fmobj.daikuan_total2.value = daikuan_total;
                //首期付款
                fmobj.money_first1.value = 0;
                fmobj.money_first2.value = 0;
            }
            //1.本金还款
            //月还款
            var all_total2 = 0;
            var month_money2 = "";
            for(j = 0; j < month; j++){
                //调用函数计算: 本金月还款额
                huankuan = getMonthMoney2(lilv, daikuan_total, month, j);
                all_total2 += huankuan;
                huankuan = Math.round(huankuan * 100) / 100;
                //fmobj.month_money2.options[j] = new Option( (j + 1) +"月," + huankuan + "(元)", huankuan);
                month_money2 += (j + 1) + "月," + huankuan + "(元)\n";
            }
            //alert(month_money2);
            fmobj.month_money2.value = month_money2;
            //还款总额
            fmobj.all_total2.value = Math.round(all_total2 * 100) / 100;
            //支付利息款
            fmobj.accrual2.value = Math.round( (all_total2 - daikuan_total) * 100) / 100;
            //2.本息还款
            //月均还款
            var month_money1 = getMonthMoney1(lilv, daikuan_total, month);//调用函数计算
            //fmobj.month_money1.value = Math.round(month_money1 * 100) / 100 + "(元)";
            $("#month_money1").val(Math.round(month_money1 * 100) / 100 + "(元)");
            //还款总额
            var all_total1 = month_money1 * month;
            fmobj.all_total1.value = Math.round(all_total1 * 100) / 100;
            //支付利息款
            fmobj.accrual1.value = Math.round( (all_total1 - daikuan_total) * 100) / 100;
        }
        if($("#dengeben2").attr("checked")){
            fmobj.fangkuan_total1.value = fmobj.fangkuan_total2.value;
            fmobj.daikuan_total1.value = fmobj.daikuan_total2.value;
            fmobj.all_total1.value = fmobj.all_total2.value;
            fmobj.accrual1.value = fmobj.accrual2.value;
            fmobj.money_first1.value = fmobj.money_first2.value;
            fmobj.month1.value = fmobj.month2.value;
            $("#month_money1").val(month_money2);
            //fmobj.month_money1.value = fmobj.month_money2.value;
        }
    }
        //验证是否为数字
        function reg_Num(str){
            if (str.length == 0){return false;}
            var Letters = "1234567890.";

            for(i = 0; i < str.length; i++){
                var CheckChar = str.charAt(i);
                if (Letters.indexOf(CheckChar) == -1){return false;}
            }
            return true;
        }

        //得到利率
        function getlilv(lilv_class, type, years){
            var indexNumSd = getArrayIndexFromYeara(years, 1); // 商贷
            var indexNumGj = getArrayIndexFromYeara(years, 2); // 公积金
            var lilv_class = parseInt(lilv_class);
            if(type == 1) {
                return lilv_array[lilv_class][type][indexNumSd];
            } else if(type == 2) {
                return lilv_array[lilv_class][type][indexNumGj];
            }
        }

        //本金还款的月还款额(参数: 年利率 / 贷款总额 / 贷款总月份 / 贷款当前月0～length-1)
        function getMonthMoney2(lilv, total, month, cur_month){
            var lilv_month = lilv / 12;//月利率
            //return total * lilv_month * Math.pow(1 + lilv_month, month) / ( Math.pow(1 + lilv_month, month) -1 );
            var benjin_money = total / month;
            return (total - benjin_money * cur_month) * lilv_month + benjin_money;
        }

        //本息还款的月还款额(参数: 年利率/贷款总额/贷款总月份)
        function getMonthMoney1(lilv, total, month){
            var lilv_month = lilv / 12;//月利率
            return total * lilv_month * Math.pow(1 + lilv_month, month) / ( Math.pow(1 + lilv_month, month) -1 );
        }

        
        function loanReset(fmobj){
            fmobj.reset();
            if (fmobj.name == "calc1"){
                $('#calc1_js_div1').show();
                $('#calc1_js_div2').hide();
                $('#calc1_zuhe').hide();
                $('#calc1_benjin').hide();
            }else{
                $('#calc2_js_div1').show();
                $('#calc2_js_div2').hide();
                $('#calc2_zuhe').hide();
                $('#calc2_benxi').hide();
            }
        } 
        
        function chanage_type_mm(){
            if($("#dengeben2").attr('checked'))
                $("#type1_mm1").html('&nbsp;&nbsp;月均还款：<textarea id="month_money1" rows="5" cols="16" ></textarea>') ;
            else
                $("#type1_mm1").html('&nbsp;&nbsp;月均还款：<input id="month_money1" type="text" class="guestbook02" value="" />元') ;
        }


        function exc_jsfd(fmobj, v){
            //var fmobj=document.calc1;
            if (fmobj.name == "formt2"){
                if (v == 1){
                    $('calc1_js_div1').style.display = 'block';
                    $('calc1_js_div2').style.display = 'none';
                    $('calc1_zuhe').style.display = 'none';
                    fmobj.type.value = 1;
                }else{
                    $('calc1_js_div1').style.display = 'none';
                    $('calc1_js_div2').style.display = 'block';
                }
            }else{
                if (v == 1){
                    $('#calc1_js_div1').show();
                    $('#calc1_js_div2').hide();
                    $('#calc1_zuhe').hide();
                    fmobj.type.value = 1;
                }else{
                    $('#calc1_js_div1').hide();
                    $('#calc1_js_div2').show();
                }
            }
        }
        
        function displaySubMenu(li) {
            var subMenu = li.getElementsByTagName("ul")[0];
            subMenu.style.display = "block";
        }
        function hideSubMenu(li) {
            var subMenu = li.getElementsByTagName("ul")[0];
            subMenu.style.display = "none";
        }
        function toggleCity() {
            $("#citydiv").toggle();
        }
